<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Backbone Test Page</title>
<script type="text/javascript" src="./js/lib/jquery/1.8.3/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="./js/lib/underscore/underscore.js"></script>
<script type="text/javascript" src="./js/lib/backbone/1.0.0/backbone.js"></script>

<script type="text/javascript">

/**************** 数据与服务器 **************************/

Backbone.sync = function(method, model) {
	console.log("method: ", method, "model: ", JSON.stringify(model));
	model.id = 1;
}

var M = Backbone.Model.extend({
	defaults: {
		name: "hello"
	},
	url: 'http://10.96.88.197:8088/lsdir?action=fsq_browse&path=/storage'
	// contentType: "application/json"
});

var m = new M;
m.save();
m.save({name: 'hi'});


var C = Backbone.Collection.extend({
	initialize: function() {
		this.on("reset", function() {
			console.log("reset~!");
		});
	},
	url: "http://10.96.88.197:8088/lsdir?action=fsq_browse&path=/storage/Data"
	// contentType: "application/json"
});
var models = new C;
models.fetch();


</script>
</head>
<body>

</body>
</html>